![]() |
PATH![]() |
![]() ![]() |
AppleScript defines the constants yes , no , and ask for use with the Close command. These constants are described in Table A-2.
The following script creates a new document, inserts some text into it, and closes the document, asking the user whether to save it.
tell application "AppleWorks"
-- Create a new document and insert some previously gathered text.
make new document at beginning with properties ¬
{name:"New Report"}
-- Create a selection and replace it with the gathered text.
select text body of document "New Report"
set selection of document "New Report" to myText
close document "New Report" saving ask
end tell
The term saving ask means ask the user whether to save, while saving no means do not save any changes to the closed document and saving yes means save without asking.